<%@page import="com.lgx.mall.business.entity.Order"%>
<%@page import="com.lgx.right.entity.User"%>
<%@page import="com.lgx.common.web.Constants"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	long productId = (Long)request.getAttribute("productId");
	
	User onlineUser = (User)request.getSession().getAttribute(Constants.LOGIN_USER);
	long userId = 0;
	if(onlineUser != null){
		userId = onlineUser.getId();
	}
	
	Order order = (Order)request.getAttribute("order");
	long orderId = 0;
	if(order != null){
		orderId = order.getId();
	}
	
	String detailIds = (String)request.getAttribute("detailIds");
	if(detailIds == null)detailIds = "";
%>
<!DOCTYPE html>
<html>
<jsp:include page="/product/head.ftl" />
<script type="text/javascript">
	var path = "<%=path%>";
	var userId = <%=userId%>;
	var orderId = <%=orderId%>;
	var detailIds = "<%=detailIds%>";
	var productId =  <%=productId%>;
	
	function hasAdd(id){
		var ids = detailIds.split(',');
		for(var i=0;i<ids.length;i++){
			if(ids[i] == id){
				return false;
			}
		}
		return true;
	}
	
	function keyDown(event){
		if(event.keyCode == 13)
		{
			login();
		}
	}
</script>
<body>
<jsp:include page="/product/pop-login.ftl"></jsp:include>
<jsp:include page="/basic/miniNav.ftl" />

<jsp:include page="/basic/header.ftl" />
<!-- 购物车 -->
<jsp:include page="/basic/nav.ftl">
	<jsp:param name="aid" value="0" />
</jsp:include>

<jsp:include page="/product/product.ftl" >
	<jsp:param name="productId" value="<%=productId %>" />
</jsp:include>
<jsp:include page="/basic/guide.ftl" />
<jsp:include page="/basic/partner.ftl" />
<jsp:include page="/basic/foot.ftl" />

<!-- S 自定义脚本 -->
<script src="<%=basePath %>js/jquery-1.3.2.min.js"></script>
<script src="<%=basePath %>js/jquery.soChange-min.js"></script>
<script src="<%=basePath %>js/pro_page_js.js"></script>
<script src="<%=basePath %>js/mini-car.js"></script>
<script src="<%=basePath %>js/tab.js"></script>
<script src="<%=basePath %>js/index_base.js"></script>
<script src="<%=basePath %>js/md5.js"></script>
<script type="text/javascript" src="<%=basePath %>jBox/jquery.jBox-2.3.min.js"></script>
<script type="text/javascript" src="<%=basePath %>jBox/i18n/jquery.jBox-zh-CN.js"></script>
<script type="text/javascript" src="http://v2.jiathis.com/code/jia.js" charset="utf-8"></script>
<!-- E 自定义脚本 -->
</body>
</html>